<?php
namespace Common\Common;

use Think\Controller;
use Common\Common\CommonFunction;
use Common\Model\LogOrderCenterModel;

/**
 *
 * 支付类
 *
 *
 */
class PurchaseLibrary
{

	private $productId     = null;
	private $transactionId = null;

	/**
	 *	20140911 koko.tang
	 *	create order
	 **/

	//根据具体 框架 以及需求修改
	public function createOrder($userID,$productKey,$productName,$amount){


		//order_id 生成
		$new_order_id = CommonFunction::guid();


		$orderModel = new LogOrderCenterModel();
		$data = array(

    		'order_id' => $new_order_id,
    		'user_id' => $userID,
    		'productId' => $productKey,
    		'productName' => $productName,
    		'amount' => $amount,
		);
		
		$ret = $orderModel->add($data);



		return $new_order_id;


	}


	public function checkOrder($orderId){


		return "success";

	}

}